package com.steven.design.XingWei_Pattern.DieDaiQi;

import java.util.Arrays;
import java.util.List;

public class NumberList {
    private List<String> list = Arrays.asList("a","c","d","e","f","g");

    public MyIterator iterator(){
        return new itr();
    }

    private class itr implements  MyIterator {
        private Integer index=0;

        @Override
        public boolean hasNext() {
            return index<list.size();
        }

        @Override
        public String next() {
            return list.get(index++);
        }
    }
}
